package 笔试.字节;

import java.util.Scanner;

/**
 * @author:谢君臣
 * @Date:2021/9/26-21:33
 * @version:1.0
 * @function:
 */
public class Main0917 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while (n>0){
            int x = scanner.nextInt();
            int a = getNum(1+x);
            int b = getNum(a+x);
            System.out.println(a*b);
        }
    }
    public static int getNum(int num){
        while (true){
            num ++;
            for (int i = 2; i < Math.sqrt(num); i++) {
                if (num%i==0) {

                }
            }
        }
    }
}
